home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
asmutil
/
d86bios4.zip
/
XBIOS.8
< prev
next >
Wrap
Text File
|
1989-07-07
|
20KB
|
564 lines
;---------------
; XBIOS test driver for BIOS.8
;---------------
; Copyright 1987-88 Eric Isaacson. All rights reserved. Permission to
; copy and use this module is granted ONLY for machines registered for both
; the A86 assembler and the D86 debugger.
; XBIOS is a program that exercises the BIOS.8 module. I am providing it
; to assist those who wish to assist me in porting my D86 debugger to
; machines with non-IBM-compatible BIOSes.
;
; You may simulate the "B" switch of the D86 debugger by providing a digit
; in the command tail. The digit must follow the single space following
; the XBIOS name; e.g. XBIOS 9 for Sirius/Victor.
; You use this source module as follows:
;
; 1. Modify the module BIOS.8 to accommodate your specific machine. You
; should NOT need to modify this module, except possibly to add a
; new HELP-key name just before the declcaration HELP_HELP below.
;
; 2. Assemble both modules with the command A86 XBIOS.8 BIOS.8
; (Command is provided as MAKX.BAT in this package; just type MAKX.)
;
; 3. Run the resulting program XBIOS.COM. The program will run tests
; of the BIOS function calls, and tell you about them. If everything
; looks good, then your BIOS.8 probably works.
;
; 4. The XBIOS program ends with an interactive mode, displaying keystrokes.
; Please try every key on your keyboard, both with and without any
; shift-style keys (ALT, SHIFT, CTRL, SECOND, etc.). Write down the
; codes that result.
;
; 5. Send me the codes you wrote down, together with your new BIOS.8. I'll
; incorporate it into D86. Thanks!
; This is a "quick-and-dirty" program. It does not meet my standards for
; professionally-documented source code (no procedure-level comments).
JMP MAIN
ALTF10_HELP: ; HELP-key name for the IBM-PC
DB 'Alt-F10',0
F11_HELP: ; HELP-key name for the TI-PC
DB 'F11',0
PF5_HELP:
DB 'Ctrl-PF5',0
ALTJ_HELP:
DB 'Alt-J',0
MENU_HELP:
DB 'Menu',0
; If your machine uses a different HELP-KEY, declare its name above this line.
HELP_HELP:
DB 'HELP',0
SWITCH EQU B[$-'A']
DB 26 DUP 080
EGA_ATTRS DW 04D1F ; attribute bytes for EGA video
CGA_ATTRS DW 0F007 ; attribute bytes for CGA video
LAST_LINE DW ? ; variable stored by the D86 BIOS interface
ENABLE_PORT DW ? ; BIOS specific, used by Wang for a port number
V_FLAG DB ? ; debugger variable consulted by IBM BIOS_INIT
WAVY_COUNT DB ? ; count of how many wavy messages have been output
; DWB causes the initialization of alternating words and bytes
DWB MACRO #RX1L
DW #X
DB #AX
#E2#EM
SKIP2 MACRO ; skip over the following 2 opcode bytes
DB 03D ; CMP AX,iw opcode will do the job
#EM
SCREEN_P EQU 08000 ; screen buffer is at 08000
; The following are convenient prefix-abbreviations for returned key-codes.
CTRL EQU -040 ; e.g. CTRL'A' -- WARNING CTRL'a' will be wrong!!
FUNC EQU 59+111 ; e.g. FUNC 1 for the F1 function key
SHIFT_F EQU 84+111 ; e.g. SHIFT_F 3 for the shifted F3 key
CTRL_F EQU 94+111 ; e.g. CTRL_F 10 for the control-F10 key
ALT_F EQU 104+111 ; e.g. ALT_F 4 for the Alt-F4 key
ALT_N EQU 120+111 ; e.g. ALT_N 5 for the Alt-5 key
BIOS_CALLS: ; pointers to BIOS-specific action routines
VID_COPY DW MONO_COPY ; video copy
VID_ATTR DW IBM_ATTR ; set attribute at DI to AL
VID_FIX DW IBM_FIX ; fix video screen
BIOS_BELL DW IBM_BELL ; ring bell
BIOS_KEY DW IBM_KEY ; fetch a keystroke
BIOS_SAVE DW IBM_SAVE ; save user's BIOS state (Sanyo only)
BIOS_RESTORE DW IBM_RESTORE; restore the saved BIOS state (Sanyo only)
VIDEO_SEG DW ? ; pointer to physical video display segment
ATTR_BYTES DW ; hardware-dependent video codes
NORM_ATTR DB 7 ; code for normal video display
REV_ATTR DB 070 ; code for reversed-video display
N_BIOS_CALLS EQU ($-BIOS_CALLS)/2
; CTRL_JUMPS defines the single-key commands recognized by the debugger. Each
; DW below is an address to be jumped to whenever the following DB byte is
; taken as a single-key input by the debugger command processor.
CTRL EQU -040
CTRL_JUMPS:
DWB F1_MSG, FUNC 1
DWB F2_MSG, FUNC 2
DWB F3_MSG, FUNC 3
DWB F4_MSG, FUNC 4
DWB F5_MSG, FUNC 5
DWB F6_MSG, FUNC 6
DWB F7_MSG, FUNC 7
N_FUNCS EQU ($-CTRL_JUMPS)/3
L1: ; control-key functions start here
DWB DOWN_MSG, 80+112
DWB PGDN_MSG, 81+112
DWB UP_MSG, 72+112
DWB PGUP_MSG, 73+112
DWB HOME_MSG, 71+112
DWB SHF7_MSG, SHIFT_F 7
DWB ALTF9_MSG, ALT_F 9
N_CONTROL_KEYS EQU ($-L1)/3
DW F10_MSG
SWITCH_KEY DB FUNC 10 ; key code for FUNC 10 (switch screens)
DW HELP_HELP
HELP_KEY DB ALT_F 10 ; key code for the debugger's HELP key
DWB 0, 0FF ; terminator for this table
MAIN:
CALL XBIOS_SWITCH ; scan the command-tail switch, if any
CALL BIOS_INIT ; initialize our specific BIOS
MOV DS,ES,SS ; restore segment registers
CALL TEST_INIT ; display the settings produced, prompt for key
CALL TEST_KEY_BELL ; test the simple key input and bell functions
CALL TEST_VIDEO ; test some simple video displays
CALL TEST_KEY_CODES ; enter the interactive key-code display loop
MOV AX,04C00 ; MS-DOS codes for successful program exit
INT 33 ; exit back to the operating system
FIRST_TESTING:
DB 'Survived BIOS_INIT.',0D,0A
DB 'Subdirectory character is set to "'
SUBDIR_CHAR DB '\'
DB '".',0D,0A
DB 'Video memory is at segment register value '
VIDEO_DISPLAY:
DB 'xxxx.',0D,0A
DB 'The normal attribute byte is '
NORM_DISP:
DB 'xx.',0D,0A
DB 'The reverse attribute byte is '
REV_DISP:
DB 'xx.',0D,0A
DB 'The HELP key is labelled ',0
HELP_MSG DW ALTF10_HELP
POST_HELP:
DB '.',0D,0A
DB 'Is this right?',0D,0A,0D,0A
DB 'First testing BIOS key input and bell-ringing.',0D,0A,0
TEST_INIT: ; make initial display of BIOS variables
MOV BX,VIDEO_SEG ; fetch the video segment register value
MOV DI,VIDEO_DISPLAY ; point to it position in the display message
MOV AL,BH ; fetch the high byte of the value
CALL HEX_AL ; output the high byte
MOV AL,BL ; fetch the low byte of the value
CALL HEX_AL ; output the low byte
MOV DI,NORM_DISP ; point to NORM_ATTR value in message
MOV AL,NORM_ATTR ; fetch the value
CALL HEX_AL ; put the hex value into the message
MOV DI,REV_DISP ; point to REV_ATTR value in message
MOV AL,REV_ATTR ; fetch the value
CALL HEX_AL ; put the hex value into the message
MOV SI,FIRST_TESTING ; point to the first message
CALL MESSAGE ; output the message
MOV SI,HELP_MSG ; point to the name of the HELP key
CALL MESSAGE ; output the name
MOV SI,POST_HELP ; point to the message after the HELP name
JMP MESSAGE ; output the message
XBIOS_SWITCH:
MOV AX,[081] ; fetch the command-tail switch, if any
CMP AL,0D ; is there a command tail?
JE RET ; return if not
MOV AL,AH
SUB AL,'0' ; reduce digit to its binary value
JC RET ; return if there was not a digit
MOV SWITCH'B',AL ; there was a digit: set the B switch to its value
RET
VID_TEST_MSG:
DB 'Now we''ll output directly to video memory.',0D,0A
DB 'Type any two keys--',0D,0A
DB 'The screen will go blank after the first keystroke.',0D,0A,0
ALPHABET_MSG:
DB 'Now letters A to X go down the left.',0
H_MSG:
DB 'Reverse video on the H.',0
AFTER_M_MSG:
DB 'Reverse video in second character beyond the M.',0
H_SPOT EQU ('H'-'A') * 160
AFTER_M_SPOT EQU ('M'-'A') * 160 + 4
TEST_VIDEO:
MOV SI,VID_TEST_MSG ; point to the "Now testing video" message
CALL MESSAGE ; output the message
CALL KEY_ONLY ; take a keystroke
CALL FIRST_FILL ; blank the screen
CALL GET_KEY ; take another keystroke
CALL ALPHA_LINES ; put out the alphabet along the side
MOV SI,ALPHABET_MSG ; point to message telling about it
CALL TOP_